package com.sample.seata.controller;

import com.sample.seata.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    private Logger logger = LoggerFactory.getLogger(UserController.class);

    @Autowired
    private UserService productService;

    @GetMapping("/valid_user")
    public void validUser(@RequestParam("userId") Long userId) throws Exception {
        logger.info("[检查用户信息] 收到用户信息, 用户ID:{}", userId);
        productService.validUser(userId);
    }

}
